package cn.liuyi.weiyi;

import android.content.Context;
import android.content.Intent;
import android.os.Bundle;
import android.os.Handler;
import android.view.Gravity;
import android.view.LayoutInflater;
import android.view.View;
import android.widget.AdapterView;
import android.widget.AdapterView.OnItemClickListener;
import cn.liuyi.weiyi.adapter.TransactionRecordAdapter;

import com.actionbarsherlock.app.ActionBar;
import com.actionbarsherlock.app.ActionBar.LayoutParams;
import com.actionbarsherlock.app.SherlockActivity;

import org.json.JSONObject;

import se.emilsjolander.stickylistheaders.StickyListHeadersListView;

public class TransactionRecordActivity extends SherlockActivity
  implements AdapterView.OnItemClickListener
{
  ActionBar actionBar;
  Context context;
  LayoutInflater inflater;
  JSONObject jsonInfo;
  Handler mHandler;
  String response;
  View title_bar;
  StickyListHeadersListView transaction_record_lv;

  private void initComponent()
  {
    this.transaction_record_lv = ((StickyListHeadersListView)findViewById(2130968689));
    TransactionRecordAdapter localTransactionRecordAdapter = new TransactionRecordAdapter(this.context);
    this.transaction_record_lv.setAdapter(localTransactionRecordAdapter);
    this.transaction_record_lv.setOnItemClickListener(this);
  }

  private void initEventListener()
  {
  }

  private void initTitleBar()
  {
	ActionBar.LayoutParams lp = new ActionBar.LayoutParams(ActionBar.LayoutParams.MATCH_PARENT,ActionBar.LayoutParams.WRAP_CONTENT,Gravity.CENTER);
    this.title_bar = this.inflater.inflate(R.layout.transaction_record_action_bar, null);
    this.actionBar.setCustomView(this.title_bar, lp);
    this.actionBar.setDisplayShowHomeEnabled(false);
    this.actionBar.setDisplayShowTitleEnabled(false);
    this.actionBar.setDisplayOptions(16);
    this.actionBar.setDisplayShowCustomEnabled(true);
  }

  protected void onCreate(Bundle paramBundle)
  {
    super.onCreate(paramBundle);
    setContentView(R.layout.activity_transaction_record);
    this.inflater = getLayoutInflater();
    this.actionBar = getSupportActionBar();
    this.context = this;
    initTitleBar();
    initComponent();
    initEventListener();
  }

  public void onItemClick(AdapterView<?> paramAdapterView, View paramView, int paramInt, long paramLong)
  {
    Intent localIntent = new Intent(this.context, TransactionDetailActivity.class);
    this.context.startActivity(localIntent);
  }
}